﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.IO;
using System.Xml.Linq;

namespace CUI.CUIOption
{
    public static class OptionCreator
    {
        public static Dictionary<string, List<OptionItems>> CreateFormOption(XElement xml)
        {
            var returnValue = new Dictionary<string, List<OptionItems>>();

            foreach (var option in xml.Elements())
            {
                var temp = OptionOptionItemsHelp.XMLToOptionItems(option);
                if (!String.IsNullOrEmpty(temp.Key))
                {
                    returnValue.Add(temp.Key, temp.Value);
                }
            }

            return returnValue;
        }
    }
}